source('dados.R')
source('cenas/mc_integral1.R')

t <- system.time({

xs <- seq(xlim[1], xlim[2], by=5)
ys <- rep(0, length(xs))
for(i in 1:length(xs)) {
	ys[i] <- mc_integrate(fdp, xlim[1], xs[i], m=10000)
	print(round(i / length(xs), 2))
}

plot(xs, ys, type='l',
	main='fdc (integral method 1)',
	xlab='x', ylab='F(x)',
	lwd=2, col=rgb(0,0,1,.5),
	xlim=xlim, ylim=c(0,1))
polygon(c(xs,xs[length(xs)],0), c(ys,0,0), col=rgb(0,0,1,.1), border=NA)

})
print(t)

